<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>WebView</title>
    <style type="text/css">
        body {
          background: #ccffcc;
        }
        .btn{
          line-height: 40px;
          margin: 10px;
          background: #cccccc;
        }
    </style>
</head>
<body>
<h2>WebView</h2>
<div><span>请输入要传递的值：</span><input type="text" id="input"></div>
<div id="btn"><span class="btn">js->原生</span></div>
<script type="text/javascript">
    var btnEle = document.getElementById("btn");
    var inputEle = document.getElementById("input");
    btnEle.addEventListener("click",function(){
      var str = inputEle.value;
      if(window.AwesomeWebView){
        AwesomeWebView.setValue(str);
      }else{
        alert(str);
      }
    });
    var remote = function(str){
      inputEle.value = str;
    }
</script>
</body>
</html>